package com.saydc.forms.caracteristicas;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

public class ListadoCaracteristicasForm extends ActionForm {

	private static final long serialVersionUID = 1L;
	private int[] seleccionados;

	
	public int[] getSeleccionados() {
		return seleccionados;
	}
	public void setSeleccionados(int[] seleccionados) {
		this.seleccionados = seleccionados;
	}
	
	@Override
	public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
		ActionErrors errors = new ActionErrors();
		if(seleccionados == null){
			errors.add("selectedVacio", new ActionMessage("error.caracteristicas.listaVacia"));
		}
		return errors;
	}
}
